try:
    print('-----test--1---')
    open('123.txt','r')
    print('-----test--2---')
    print(num)
except (IOError,NameError) as errMsg:
    print(errMsg)
else:
    print("no error")
finally:
    print("最终都会被执行的地方")
